﻿using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using ZR.DataCollection.ICommunication;

namespace ZR.DataCollection.InheritanceClass
{
    public abstract class BaseHandScanCode : IScannCode
    {
        public abstract event Action<string> Notify_Invoke;

        public abstract event Action<string, string> ScanCode_Notify;

        public Thread _thread = null;
        public SerialPort _SerialPort = null;

        public TcpClient _tcpClient = null;
        public bool Finish { get; set; }

        public void ScanClose()
        {
            if (_SerialPort != null)
            {
                _SerialPort.Close();
                _SerialPort = null;
            }
            if (_tcpClient != null)
            {
                _tcpClient.Close();
                _tcpClient = null;
            }
        }
    }
}